package itheima.C02_xml;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.util.List;

public class Test {
    public static void main(String[] args) throws DocumentException {
        SAXReader sax = new SAXReader();

        Document doc = sax.read("src/itheima/C02_xml/1.xml");

        Element root = doc.getRootElement();
        System.out.println("根标签名称" + root.getName());
        List<Element> elements = root.elements("cat");
        for (Element element : elements) {
            System.out.println("子标签名称" + element.getName());
        }

    }
}
